package com.newtype.meeting.client.model;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.extjs.gxt.ui.client.data.BaseModel;
import com.newtype.meeting.shared.MeetingNotifyDTO;

/**
 * 会议通知实体类
 * @author 汪恭泽
 * Jun 30, 2011 9:11:55 AM
 */
@SuppressWarnings("serial")
@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
public class MeetingNotify extends BaseModel implements Serializable {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
	private String id;
	@Persistent
	private String meetingID;
	@Persistent
	private String accountID;//通知参加会议者
	@Persistent
	private Integer attendTAG;////参加（1）/不参加（0）会议
	@Persistent
	private String replyContent;//回复内容
	@Persistent
	private Integer htmlTAG;//默认0
	@Persistent
	private Date readDate;//查看时间
	@Persistent
	private Date submitDate;//提交时间
	@Persistent
	private Integer attendedTAG;//点名表（参加:1）（未参加:null）
	@Persistent
	private Integer cancelTAG;//默认null
	@Persistent
	private Integer delTAG;//默认0
	@Persistent
	private Integer tempTAG;//默认0
	@Persistent
	private Integer needCheck;//默认null

	public MeetingNotify() {

	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getMeetingID() {
		return meetingID;
	}

	public void setMeetingID(String meetingID) {
		this.meetingID = meetingID;
	}

	public String getAccountID() {
		return accountID;
	}

	public void setAccountID(String accountID) {
		this.accountID = accountID;
	}

	public Integer getAttendTAG() {
		return attendTAG;
	}

	public void setAttendTAG(Integer attendTAG) {
		this.attendTAG = attendTAG;
	}

	public String getReplyContent() {
		return replyContent;
	}

	public void setReplyContent(String replyContent) {
		this.replyContent = replyContent;
	}

	public Integer getHtmlTAG() {
		return htmlTAG;
	}

	public void setHtmlTAG(Integer htmlTAG) {
		this.htmlTAG = htmlTAG;
	}

	public Date getReadDate() {
		return readDate;
	}

	public void setReadDate(Date readDate) {
		this.readDate = readDate;
	}

	public Date getSubmitDate() {
		return submitDate;
	}

	public void setSubmitDate(Date submitDate) {
		this.submitDate = submitDate;
	}

	public Integer getAttendedTAG() {
		return attendedTAG;
	}

	public void setAttendedTAG(Integer attendedTAG) {
		this.attendedTAG = attendedTAG;
	}

	public Integer getCancelTAG() {
		return cancelTAG;
	}

	public void setCancelTAG(Integer cancelTAG) {
		this.cancelTAG = cancelTAG;
	}

	public Integer getDelTAG() {
		return delTAG;
	}

	public void setDelTAG(Integer delTAG) {
		this.delTAG = delTAG;
	}

	public Integer getTempTAG() {
		return tempTAG;
	}

	public void setTempTAG(Integer tempTAG) {
		this.tempTAG = tempTAG;
	}

	public Integer getNeedCheck() {
		return needCheck;
	}

	public void setNeedCheck(Integer needCheck) {
		this.needCheck = needCheck;
	}

	public MeetingNotifyDTO toLightWeightDTO(Meeting meeting) {
		return new MeetingNotifyDTO(id, getMeetingID(), getAccountID(),
				getAttendTAG(), getReadDate(), meeting.getSubject(), meeting
						.getOriginatorName(), meeting.getChairName(), meeting
						.getStartDate());
	}


	public void updateProperties() {
		set("id", getId());
		set("meetingID", getMeetingID());
		set("accountID", getAccountID());
		set("attendTAG", getAttendTAG());
		set("replyContent", getReplyContent());
		set("htmlTAG", getHtmlTAG());
		set("readDate", getReadDate());
		set("submitDate", getSubmitDate());
		set("attendedTAG", getAttendedTAG());
		set("cancelTAG", getCancelTAG());
		set("delTAG", getDelTAG());
		set("tempTAG", getTempTAG());
		set("needCheck", getNeedCheck());
	}

}
